1. Field of the Invention
The present invention relates to the dynamic creation of a look-up table for mapping between color spaces. More particularly, the invention concerns creation of such table at runtime using a device""s profile so as to optimize color-matching performance and best take advantage of the resources of a particular computing system.
2. Description of the Related Art
One goal of modern color management is generation of uniform output images using different color image output devices. In particular, it is desired that a color image generated for output using a first image output device would appear similar if output using a second different image output device. For example, one computer system could use color image data to generate color image output using a color laser printer. The same color image data could also be output by a color ink jet printer coupled to a second computer system. In such a case, it would be preferable that the color image output from the color laser and ink jet printers both appear similar.
However, a color defined in the color image data may be interpreted or represented differently by different output devices.
Colors are defined using a color model, or color space. Examples of color spaces include RGB (red, green and blue), CMY (cyan, magenta and yellow) and CMYK (cyan, magenta, yellow and black). Color spaces may be device dependent, such as the above examples, since they define the colors that may be output by a given device. Other color spaces are device independent, since they are not associated with a particular device. Examples of device independent color spaces include CIELab which is a color appearance space and CIEXYZ which is a device independent color measurement space.
One conventional technique for attempting to ensure similar output images from different image output devices involves a process by which the color image data is transformed from a device-dependent color space to a device-independent color space. A device profile associated with a given device provides the information necessary to convert device dependent color data of a given device to a device independent color space.
A color management system transforms colors from one color device""s color space to another device""s color space. For example, in a printing process, a color is transformed from a monitor""s RGB values to a printer""s CMY values. During the transformation process, colors are matched between the two devices usually by first generating a device independent color space interpretation. The device independent output may then be converted to one or more other device dependent color spaces for use by a particular device.
A color management system may implement an algorithmic model to perform the transformation between color spaces using parametric data provided in a device profile, or use a look-up table to convert from one color space to another. Typically, an algorithmic process is used for monitors, while the look-up table approach is used for printers.
In one example of the algorithmic process, monitor-specific color data is converted to a printer""s color space by first transforming the monitor color data to a device independent color appearance space (e.g., CIELab). A gamut mapping is performed on the CIELab output to map the colors to the gamut of colors of the printer. The gamut-mapped CIELab is then transformed into the printer-specific color space using the printer""s device profile.
A monitor device profile typically includes three 1-D input lookup tables (LUTS) one for each of red, green and blue colors, and a 3xc3x973 matrix which is used to convert from RGB to CIEXYZ. An algorithm in the color management module is used to convert from CIEXYZ to color appearance space. The monitor profile contains the needed parameters as input to the transformation algorithm used to transform the CIEXYZ color to the color appearance space.
To make the above process more efficient, a 3-D color look up table (LUT) may be created that combines these three operations. Use of a color LUT avoids the need to perform complicated floating-point calculations otherwise needed to transform each pixel in an image from the XYZ color space to the color appearance space. Instead, the calculations are performed once for each grid point value in the color LUT (e.g., 4913 for a 17xc3x9717xc3x9717 color LUT). Although use of a color LUT necessarily introduces interpolation calculation into the color-matching process where color data is not one of the grid points of the color LUT, interpolation calculation usually takes much less time in comparison to floating point calculations used in the color appearance conversion.
However, a color LUT is typically quite large and storing a color LUT in a device profile causes the device profile to be considerably larger than a case where the profile stores three 1-D tables and a 3xc3x973 matrix. In addition, there is no ability to change the size of a color LUT dynamically (e.g., at runtime) to take into account the resources available to the color management system.
The number of elements in a color LUT has a major impact on the speed and accuracy as well as the memory requirements of the color management system. The size of a color LUT is directly related to the number of grid steps. The more steps, or points, in the grid, the fewer interpolation calculations are needed and a higher accuracy is achieved. However, the size can be limited by the amount of memory that is available to store the color LUT.
Further, it may be that the computing resources available to the color management system are such that little, if any, advantage is gained using a color LUT over the transformation operations. In such a case, there is no need to use a color LUT, and storage of a color LUT in a profile is unnecessary. However, it is not possible to determine at the time that a profile is generated the computing resources that are available to a color management system that is to use the profile.
Thus, it would be beneficial to use a color LUT based on the computing resources that are available to a color management system. Then, in this case, the number of elements in the color LUT should be chosen in order to take full advantage of the available computing resources.
The present invention comprises a method, for use in a color management system executing in a computer system, for generating, at runtime using device profile information, a look-up table for conversion of color data from one color space to another. As it is used herein, runtime refers to a time at which the resources of a computer are known during the execution time of a color management system such that the color management system may determine an appropriate color look-up table to optimize color-matching performance and best take advantage of the resources of a particular computing system. A method according to the present invention for dynamically generating a look-up table comprises assigning a weight to each of table size, speed and accuracy factors, determining, for plural table sizes, corresponding speed and accuracy scores using the color management system, determining, for each of the plural table sizes, an aggregate of weighted scores corresponding to table size and speed and accuracy, selecting one of the plural table sizes using the aggregate of each of the plural table sizes, and generating a look-up table having the selected one of the plural table sizes.
Advantageously, the present invention provides the ability to tailor use of a color look-up table to a particular computer system and/or color management system. In addition, it is possible to generate a look-up table to accommodate any changes in requirements between speed and accuracy and/or available computing resources.
The present invention may be used to determine, based on the computing resources that are available to a color management system, whether it is desirable to generate a color LUT, and if so, the number of elements in the color LUT in order to take full advantage of the available computing resources.